<h5><i class="icon-folder-open"></i> <?= $t_documentos; ?></h5>

<ul id="myTab" class="nav nav-tabs">
    <?php
    $sql_doctipo = "SELECT * FROM doctipo ORDER BY doc_tip_nome";
    $res_doctipo = sql($sql_doctipo);
    $a = 0;
    while($linha_doctipo = mysql_fetch_array($res_doctipo)){
        
        if ($a == 0 ) { $class = "active"; } else { $class = ""; }
    ?>
    <li class="<?php echo $class; ?>">
        <a data-toggle="tab" href="#doc<?php echo $linha_doctipo['doc_tip_id'];?>"><?php echo $linha_doctipo['doc_tip_nome'];?></a>
    </li>
    <?php $a++; } ?>
</ul>

<div id="myTabContent" class="tab-content">
    <?php
    $sql_doctipo = "SELECT * FROM doctipo ORDER BY doc_tip_id";
    $res_doctipo = sql($sql_doctipo);
    $a = 0;
    while($linha_doctipo = mysql_fetch_array($res_doctipo)){
        
        if ($a == 0 ) { $class = "active in"; } else { $class = ""; }
        
    ?>
    <div id="doc<?php echo $linha_doctipo['doc_tip_id'];?>" class="tab-pane fade <?php echo $class;?>">
        <?php include "mod/documento/last.php"; ?>
    </div>
    <?php $a++; } ?>

</div>